<div id="maincontent">
    <?php
    $this->pageTitle = Yii::app()->name . ' - Contact Us';
    $this->breadcrumbs = array(
        'Liên Hệ',
    );
    ?>

    <h1>Liên Hệ Với Chúng Tôi</h1>

    <?php if (Yii::app()->user->hasFlash('contact')): ?>

        <div class="flash-success">
        <?php echo Yii::app()->user->getFlash('contact'); ?>
    </div>

    <?php else: ?>

            <p>
                Bạn có đề nghị gì với chúng tôi? Hãy cung cấp đầy đủ và chính xác thông tin theo yêu cầu. Xin cảm ơn !
            </p>

            <div class="form">

        <?php
            $form = $this->beginWidget('CActiveForm', array(
                        'id' => 'contact-form',
                        'enableClientValidation' => true,
                        'clientOptions' => array(
                            'validateOnSubmit' => true,
                        ),
            ));
        ?>


            <p class="note">Trường đánh dấu <span class="required">*</span> là bắt buộc.</p>

        <?php echo $form->errorSummary($model); ?>

            <div class="row">
            <?php echo $form->labelEx($model, 'name'); ?><br />
            <?php echo $form->textField($model, 'name'); ?>
            <?php echo $form->error($model, 'name'); ?>
        </div>

        <div class="row">
            <?php echo $form->labelEx($model, 'email'); ?><br />
            <?php echo $form->textField($model, 'email'); ?>
            <?php echo $form->error($model, 'email'); ?>
        </div>

        <div class="row">
            <?php echo $form->labelEx($model, 'phonenumber'); ?><br />
            <?php echo $form->textField($model, 'phonenumber'); ?>
            <?php echo $form->error($model, 'phonenumber'); ?>
        </div>
        <div class="row">
            <?php echo $form->labelEx($model, 'subject'); ?><br />
            <?php echo $form->textField($model, 'subject', array('size' => 60, 'maxlength' => 128)); ?>
            <?php echo $form->error($model, 'subject'); ?>
        </div>

        <div class="row">
            <?php echo $form->labelEx($model, 'body'); ?><br />
            <?php echo $form->textArea($model, 'body', array('rows' => 6, 'cols' => 50)); ?>
            <?php echo $form->error($model, 'body'); ?>
        </div>

        <div class="row">
            <?php echo $form->labelEx($model, 'service_type'); ?>
            <?php echo $form->dropDownList($model, 'service_type', array('Tên Miền' => 'Tên Miền', 'Thuê Đặt Server' => 'Thuê Đặt Server', 'Hosting' => 'Hosting', 'Thiết Kế Web' => 'Thiết Kế Web')); ?>
            <?php echo $form->error($model, 'service_type'); ?>
        </div>

        <div class="row">
            <?php echo $form->labelEx($model, 'fee'); ?>&nbsp;
            <?php echo $form->dropDownList($model, 'fee', array('1-2 triệu ' => '1-2 triệu', '3-4 triệu' => '3-4 triệu', '5-6 triệu' => '5-6 triệu', '7-10 triệu' => '7-10 triệu', '11-15 triệu' => '11-15 triệu', '16-20 triệu' => '16-20 triệu')); ?>
            <?php echo $form->error($model, 'fee'); ?>
        </div>
        <div class="row">
            <?php echo $form->labelEx($model, 'starting_date'); ?><br />
            <?php
               $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                    'model' => $model,
                    'attribute' => 'starting_date',
                    'value' => $model->starting_date,

                    'options' => array(
                        'showAnim' => 'fold',
                        'showButtonPanel' => true,
                        'autoSize' => true,
                        'dateFormat' => 'yy-mm-dd',
                        'defaultDate' => $model->starting_date,
                    ),
                ));

            ?>
            <?php //echo $form->textField($model, 'starting_date', array('class' => 'input input_r input_pryk', 'value' => 'yyyy-mm-dd')); ?>
            <?php echo $form->error($model, 'starting_date'); ?>
        </div>

        <?php if (CCaptcha::checkRequirements()): ?>
            <div class="row">
                <?php echo $form->labelEx($model, 'verifyCode'); ?>
                    <div>
                        <?php $this->widget('CCaptcha'); ?><br />
                        <?php echo $form->textField($model, 'verifyCode'); ?>
                    </div>
                    <div class="hint">Please enter the letters as they are shown in the image above.
                        <br/>Letters are not case-sensitive.</div><br />
                        <?php echo $form->error($model, 'verifyCode'); ?>
                    </div>
       <?php endif; ?>


            <div class="row buttons">
<?php echo CHtml::submitButton('Gửi đi', array("class" => "button", "id" => "submit_btn")); ?>&nbsp;
<?php echo CHtml::resetButton('Reset', array("class" => "button")); ?>
                </div>

                <br /><br />


<?php $this->endWidget(); ?>

        </div><!-- form -->

<?php endif; ?>
        </div>

        <div id="side">
            <ul>

                <li class="widget-container">
                    <h2 class="widget-title">Liên Hệ</h2>

                    <div class="text-widget"><h5>Công ty Cổ phần dịch vụ tin học Sáng tạo mới</h5></div>

                    <!--ALL INFO ABOUT COMPANIES ON SIDEBAR-->
<?php foreach ($companies as $company): ?>
                            <div class="text-widget">
                                <span class="t-green"><b><?php echo $company->name; ?></b></span><br>
                        Địa chỉ: <?php echo $company->address; ?><br />
                        Điện thoại: <?php echo $company->phone; ?><br />
                        Email: <?php echo $company->email; ?><br />
                        <br />
                    </div>
<?php endforeach; ?>

                </li>


                <li class="widget-container">
                    <h2 class="widget-title">Hỗ trợ trực tuyến</h2>

                    <div class="text-widget"><span class="t-green"><b>Kĩ thuật</b></span><br /></div>
<?php foreach ($technicalstaffs as $assistant): ?>
                        <div class="text-widget">
            <?php $imagetag = CHtml::image("http://opi.yahoo.com/online?u=" . $assistant->nick_yahoo . "&m=g&t=16", "Yahoo Messenger Icons", array("border" => "0")); ?>
<?php echo CHtml::link($imagetag, "ymsgr:sendIM?" . $assistant->nick_yahoo) ?>
            <!--                <a href="ymsgr:sendIM?YOUR_YM_ID"><img src="http://opi.yahoo.com/online?u=YOUR_YM_ID&m=g&t=1" alt="Yahoo Messenger Icons" border="0" />-->
                        </div>
<?php endforeach; ?>

                    <br />

                    <div class="text-widget"><span class="t-green"><b>Tư vấn</b></span><br /></div>
<?php foreach ($counselors as $assistant): ?>
                            <div class="text-widget">
            <?php $imagetag = CHtml::image("http://opi.yahoo.com/online?u=" . $assistant->nick_yahoo . "&m=g&t=16", "Yahoo Messenger Icons", array("border" => "0")); ?>
<?php echo CHtml::link($imagetag, "ymsgr:sendIM?" . $assistant->nick_yahoo) ?>
                            </div>
                <?php endforeach; ?>
        </li>

        <li class="widget-container">
            <h2 class="widget-title">Hotline</h2>

            <div class="text-widget">
                Mr. Vũ Minh Tuấn <br />
                Số điện thoại: 0982 609 010
            </div>
        </li>
    </ul>
</div><!-- end #side -->
<div class="clear"></div><!-- clear float -->
